<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="__CSS__/style_forum.css">
    <link rel="stylesheet" href="__CSS__/reset.css">
    <link rel="stylesheet" href="__ACSS__/alogin.css">
    <link rel="stylesheet" href="__ACSS__/binmesdeal.css">
    <link rel="stylesheet" href="__ACSS__/secdeal.css">
    <title>版块管理 - ThinkPHP后台管理</title>
    <script type="text/javascript" src="__JS__/jquery-3.4.1.min.js"></script>
    <script type="text/javascript" src="__JS__/loadinghtml.js"></script>
    <script src="__JS__/del.js"></script>
</head>

</style>

<body>
    <div id="header" class="top">
        <div id="hd-main">
            <a id="alink" href="../../forum_guzp/guzp.html" title="返回首页"></a>
            <ul id="main-nav">
                <li><a href="{:url('deal/mesdeal')}">帖子管理</a></li>
                <li style="background-color: #656565"><a href="{:url('deal/secdeal')}">版块管理</a></li>
                <li><a href="{:url('bindeal/binsecdeal')}">回收站管理</a></li>
                <li><a href="{:url('adv/boxdeal')}">轮播图管理</a></li>
                <li><a href="{:url('admin/apa')}">修改密码</a></li>
                <li><a href="{:url('admin/alogout')}">注销</a></li>
            </ul>
            <div id="header-bar">
                <h3>欢迎你，{:session('auser')}</h3>
                <div id="userloginmes">
                    <a href="" id="unlogin">
                        <b></b>
                    </a>
                    <ul>
                        <li><a href="{:url('admin/alogout')}">退出</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div id="main">

        <!-- 模糊查询 -->
        <div class="recycler-top3">
            <div>
                <span>版块管理</span>

                <input type="button" value="添加新模块" class="active" onclick="show()">
                <div id="bg">
                </div>
                <div id="div" class="sechide">
                    <a href="" style="position: absolute; top: 0px;right: -1px;" class="hide" onclick="hide()">X</a>
                    <form action="{:url('deal/seccreat')}" method="POST">
                        <p>版块名:</p>
                        <input type="text" placeholder="请输入要创建的版块名称" name="s_name">
                        <p>版块说明:</p>
                        <input type="textarea" placeholder="请说明版块" name="s_remark">
                        <br>
                        <input class="button" type="submit" value="创建">
                    </form>
                </div>

            </div>
            <script>
                function show() {
                    $('#bg').show();
                    $('#div').show();
                }
                function hide() {
                    $('#bg').hide();
                    $('#div').hide();
                }
            </script>
            <div class="find">
                <form action="{:url('deal/secdeal')}" method="POST">
                    <input name="find" class="input" type="text" placeholder="请输入要查询的内容">
                    <input type="submit" value="搜索" class="submit">
                </form>
            </div>

        </div>
        
        <!-- 显示帖子 -->
        <div class="main-conter">
            <table>
                <tr id="first">
                    <th>sid</th>
                    <th>版块名称</th>
                    <th>备注</th>
                    <th>操作</th>
                </tr>
                {volist name="sec" id="secRow"}
                <tr>
                    <td>{$secRow.s_id}</td>
                    <td>{$secRow.s_name}</td>
                    <td>{$secRow.s_remark}</td>
                    <td>
                        <a href="#" onclick="update(this)">修改</a> |
                        <a href="{:url('bindeal/binsecdel',['s_id'=> $secRow.s_id])}" onclick="return del()">彻底删除</a> |
                        <a href="#" onclick="resrec(this)">回收站</a>
                    </td>
                </tr>
                {/volist}
            </table>
            <!-- {:url('deal/resrec',['s_id'=> $secRow.s_id])} -->
            <div class="secdeal-page">
                <nav id="page1">{$page | raw}</nav>
            </div>
            </div>
            <div id="update1" class="sechide">
                <form action="{:url('deal/secupdate')}" method="POST">
                    <p>版块名称</p>
                    <input id="sname" type="text" name="sname">
                    <input type="hidden" id="sid" name="sid" id="">
                    <p>备注</p>
                    <input id="remark" type="text" name="remark">
                    <br>
                    <input class="button" type="submit" value="修改">
                </form>
                <a href="" style="position: absolute; top: 0px;right: -1px;" class="upclose" onclick="upclose()">X</a>
                
            </div>
            <div id="resrec" class="sechide">
                <form action="{:url('deal/resrec')}" method="POST">
                    <p>版块名称: <span id="sName"></span></p>
                    <p>请输入要放回回收站原因</p>
                    <!-- <input type="hidden" name="sName" id="sName1"> -->
                    <input id="remark1"  type="text" name="s_reason">
                    <input type="hidden" name="remark_id" id="remark_id">
                    <br>
                    <input class="button" type="submit" value="修改">
                </form>
                <a href="" style="position: absolute; top: 0px;right: -1px;" class="upclose" onclick="rClose()">X</a>
            </div>
        </div>
        
        <script>
            function update(node) {
                $("#bg").show();
                $("#update1").show();
                var tr1 = node.parentNode.parentNode;
                $("#sid").val(tr1.cells[0].innerText);
                $("#sname").val(tr1.cells[1].innerText);
                $("#remark").val(tr1.cells[2].innerText);
            }
            function upclose() {
                $("#bg").hide();
                $("#update1").hide();
            }
            function resrec(a){
                $("#bg").show();
                $("#resrec").show();
                // var $null = a.parentElement.parentElement.rowIndex-1;
                // console.log($null);
                var tr1 = a.parentNode.parentNode;
                $("#remark_id").val(tr1.cells[0].innerText);
                $("#sName1").val(tr1.cells[1].innerText);
            }
            function rClose(){
                $("#bg").hide();
                $("#update1").hide();
            }
        </script>

    </div>
    <div id="footer"></div>
</body>

</html>